Auto merge of #3527 - nikomatsakis:master, r=alexcrichton
authorbors <bors@rust-lang.org>
Thu, 12 Jan 2017 00:45:23 +0000 (00:45 +0000)
committerbors <bors@rust-lang.org>
Thu, 12 Jan 2017 00:45:23 +0000 (00:45 +0000)
check for `CARGO_INCREMENTAL` and pass `-Zincremental` if present

Per the discussion on IRC, this adds a very simple way for cargo users to opt into incremental compilation by setting the `CARGO_INCREMENTAL` environment variable (i.e., `CARGO_INCREMENTAL=1 cargo build`). This will result in incremental data being stored into the `target/incremental` directory. Since it supplies `-Z`, this option is only intended for use on nightly compilers, though cargo makes no effort to check.

The plan is to keep incremental compilation optional until we are feeling more confident it's not going to cause problems for people. At that point, it should become part of the compilation profile. It will be the default when building in debug builds, and opt-in for release builds.


Trivial merge